package com.zz.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 系统通知信息
 * @author HUAWEI
 */
@Data
@TableName("system_notice")
public class SystemNotice implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
    * 主键
    * */
    @ApiModelProperty("主键")
    @NotNull(message = "主键不能为空")
    @TableId(type= IdType.AUTO)//主键自增
    private Integer id;

    /**
     * 用户学号
     * */
    @ApiModelProperty("学号")
    @NotNull(message = "用户学号不能为空")
    @Range(min = 1000000000, message = "用户学号为10位")
    private Integer userId;

    /**
    * 标题
    * */
    @ApiModelProperty("标题")
    private String title;

    /**
     * 通知信息
     * */
    @ApiModelProperty("通知信息")
    private String info;

    /**
     * 通知时间
     * */
    @ApiModelProperty("通知时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date time;

    /**
     * 是否已读 0未读
     * */
    @ApiModelProperty("是否已读")
    private Integer isRead;

}
